/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.kramerius.fedoraaccess.rest;

import cz.mzk.rehan.commons.DatastreamId;
import cz.mzk.kramerius.fedoraaccess.FedoraServer;
import cz.mzk.rehan.commons.Dom4jUtils;
import org.dom4j.Document;
import org.dom4j.XPath;

/**
 *
 * @author Martin Řehánek <rehan at mzk.cz>
 */
abstract class Fedora3_3Operation {

    static final XPath descriptionXpath = Dom4jUtils.createXPath("/rdf:RDF/rdf:Description");
    static final String RDF_PID_PREFIX = "info:fedora/";
    final FedoraServer fedoraServer;

    public Fedora3_3Operation(FedoraServer fedoraServer) {
        this.fedoraServer = fedoraServer;
    }

    Document getDatastreamDissemination(String pid, DatastreamId dsId) {
        return new GetXmlDatastreamDisseminationOperation(fedoraServer).run(pid, dsId);
    }

    void updateDatastreamInlineContent(String pid, DatastreamId dsId, Document content) {
        new UpdateDatastreamInlineContentOperation(fedoraServer).run(pid, dsId, content);
    }
}
